import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);

let routes = [
  {
    path: "/",
    component: () => import("../layout"),
    children: [
      {
        path: "/",
        redirect: "/timer",
      },
      {
        name: "timer",
        path: "/timer",
        component: () => import("../views/Timer"),
        children: [
          {
            path: "/timer",
            redirect: "/timer/timerbuild",
          },
          {
            name: "timerbuild",
            path: "/timer/timerbuild",
            component: () => import("../views/Timer/TimerBuild"),
          },
          {
            name: "timerhistory",
            path: "/timer/timerhistory",
            component: () => import("../views/Timer/TimerHistory"),
          },
          {
            name: "timerachieve",
            path: "/timer/timerachieve",
            component: () => import("../views/Timer/TimerAchieve"),
          },
          {
            name: "timernotachieve",
            path: "/timer/timernotachieve",
            component: () => import("../views/Timer/TimerNotAchieve"),
          },
        ],
      },
      {
        name: "task",
        path: "/task",
        component: () => import("../views/Task"),
        children: [
          {
            path: "/task",
            redirect: "/task/timerbuild",
          },
          {
            // name: "timerbuild",
            path: "/task/timerbuild",
            component: () => import("../views/Task/TimerBuild"),
          },
          {
            // name: "timerhistory",
            path: "/task/timerhistory",
            component: () => import("../views/Task/TimerHistory"),
          },
        ],
      },
      {
        name: "tomato",
        path: "/tomato",
        component: () => import("../views/Tomato"),
      },
    ],
  },
  {
    name:"timeranalyse",
    path: "/timer/timeranalyse",
    component: () => import("../views/Timer/TimerAnalyse")
    
  },
];

let router = new Router({
  mode: "hash",
  scrollBehavior: () => ({ y: 0 }),
  routes: routes,
  linkActiveClass: "timer-tab-active",
});

export default router;
